{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "# -*- coding: utf-8 -*-\n",
    "import argparse\n",
    "import logging\n",
    "import os\n",
    "\n",
    "import numpy as np\n",
    "import scipy.io as sio\n",
    "from matplotlib import pyplot as plt\n",
    "\n",
    "import utils\n",
    "from model import dsfa"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "net_shape = [128, 128, 6] \n",
    "os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\n",
    "logging.basicConfig(format='%(asctime)-15s %(levelname)s: %(message)s', datefmt='%m/%d/%Y %H:%M:%S', level=logging.INFO)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "def parser():\n",
    "    parser = argparse.ArgumentParser(description='')\n",
    "\n",
    "    parser.add_argument('-e','--epoch',help='epoches',default=2000, type=int)\n",
    "    parser.add_argument('-l','--lr',help='learning rate',default=5*1e-5, type=float)\n",
    "    parser.add_argument('-r','--reg',help='regularization parameter',default=1e-4, type=float)\n",
    "    parser.add_argument('-t','--trn',help='number of training samples',default=2000, type=int)\n",
    "    parser.add_argument('-g','--gpu', help='GPU ID', default='0')\n",
    "    parser.add_argument('--area',help='datasets', default='river')\n",
    "    args = parser.parse_args()\n",
    "\n",
    "    return args"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "class config():\n",
    "    def __init__(self):\n",
    "        self.epoch = 2000\n",
    "        self.lr = 1e-4\n",
    "        self.reg = 1e-4\n",
    "        self.trn = 3000\n",
    "        self.gpu = '0'\n",
    "        self.area = 'river'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "def main(img1, img2, chg_map, args=None):\n",
    "\n",
    "    img_shape = np.shape(img1)\n",
    "\n",
    "    im1 = np.reshape(img1, newshape=[-1,img_shape[-1]])\n",
    "    im2 = np.reshape(img2, newshape=[-1,img_shape[-1]])\n",
    "\n",
    "    im1 = utils.normlize(im1)\n",
    "    im2 = utils.normlize(im2)\n",
    "\n",
    "    chg_ref = np.reshape(chg_map, newshape=[-1])\n",
    "\n",
    "    imm = None\n",
    "    all_magnitude = None\n",
    "    differ = np.zeros(shape=[np.shape(chg_ref)[0],net_shape[-1]])\n",
    "\n",
    "    # load cva pre-detection result\n",
    "    ind = sio.loadmat(args.area+'/cva_ref.mat')\n",
    "    cva_ind = ind['cva_ref']\n",
    "    cva_ind = np.reshape(cva_ind, newshape=[-1])\n",
    "\n",
    "    i1, i2 = utils.getTrainSamples(cva_ind, im1, im2, args.trn)\n",
    "\n",
    "    loss_log, vpro, fcx, fcy, bval = dsfa(\n",
    "        xtrain=i1, ytrain=i2, xtest=im1, ytest=im2, net_shape=net_shape, args=args)\n",
    "\n",
    "    imm, magnitude, differ_map = utils.linear_sfa(fcx, fcy, vpro, shape=img_shape)\n",
    "\n",
    "    magnitude = np.reshape(magnitude, img_shape[0:-1])\n",
    "    differ = differ_map\n",
    "\n",
    "    change_map = np.reshape(utils.kmeans(np.reshape(magnitude, [-1])), img_shape[0:-1])\n",
    "\n",
    "    # magnitude\n",
    "    acc_un, acc_chg, acc_all2, acc_tp = utils.metric(1-change_map, chg_map)\n",
    "    acc_un, acc_chg, acc_all3, acc_tp = utils.metric(change_map, chg_map)\n",
    "    plt.imsave('results.png',change_map, cmap='gray')\n",
    "    plt.imshow(change_map)\n",
    "    plt.show()\n",
    "\n",
    "    return None"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "WARNING:tensorflow:From C:\\Users\\rulix\\Desktop\\cd\\demo\\model.py:14: The name tf.reset_default_graph is deprecated. Please use tf.compat.v1.reset_default_graph instead.\n",
      "\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "03/28/2020 23:39:51 WARNING: From C:\\Users\\rulix\\Desktop\\cd\\demo\\model.py:14: The name tf.reset_default_graph is deprecated. Please use tf.compat.v1.reset_default_graph instead.\n",
      "\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "WARNING:tensorflow:From C:\\Users\\rulix\\Desktop\\cd\\demo\\model.py:18: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.\n",
      "\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "03/28/2020 23:39:51 WARNING: From C:\\Users\\rulix\\Desktop\\cd\\demo\\model.py:18: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.\n",
      "\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "WARNING:tensorflow:From C:\\Users\\rulix\\Desktop\\cd\\demo\\model.py:22: The name tf.truncated_normal is deprecated. Please use tf.random.truncated_normal instead.\n",
      "\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "03/28/2020 23:39:51 WARNING: From C:\\Users\\rulix\\Desktop\\cd\\demo\\model.py:22: The name tf.truncated_normal is deprecated. Please use tf.random.truncated_normal instead.\n",
      "\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "WARNING:tensorflow:From C:\\Users\\rulix\\Desktop\\cd\\demo\\model.py:75: The name tf.self_adjoint_eig is deprecated. Please use tf.linalg.eigh instead.\n",
      "\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "03/28/2020 23:39:51 WARNING: From C:\\Users\\rulix\\Desktop\\cd\\demo\\model.py:75: The name tf.self_adjoint_eig is deprecated. Please use tf.linalg.eigh instead.\n",
      "\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "WARNING:tensorflow:From C:\\Users\\rulix\\Desktop\\cd\\demo\\model.py:76: add_dispatch_support.<locals>.wrapper (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Use tf.where in 2.0, which has the same broadcast rule as np.where\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "03/28/2020 23:39:51 WARNING: From C:\\Users\\rulix\\Desktop\\cd\\demo\\model.py:76: add_dispatch_support.<locals>.wrapper (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Use tf.where in 2.0, which has the same broadcast rule as np.where\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "WARNING:tensorflow:From C:\\Users\\rulix\\Desktop\\cd\\demo\\model.py:79: The name tf.diag is deprecated. Please use tf.linalg.tensor_diag instead.\n",
      "\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "03/28/2020 23:39:51 WARNING: From C:\\Users\\rulix\\Desktop\\cd\\demo\\model.py:79: The name tf.diag is deprecated. Please use tf.linalg.tensor_diag instead.\n",
      "\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "WARNING:tensorflow:From C:\\Users\\rulix\\Desktop\\cd\\demo\\model.py:88: The name tf.train.GradientDescentOptimizer is deprecated. Please use tf.compat.v1.train.GradientDescentOptimizer instead.\n",
      "\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "03/28/2020 23:39:51 WARNING: From C:\\Users\\rulix\\Desktop\\cd\\demo\\model.py:88: The name tf.train.GradientDescentOptimizer is deprecated. Please use tf.compat.v1.train.GradientDescentOptimizer instead.\n",
      "\n",
      "03/28/2020 23:39:53 INFO: The    0-th epochs, loss is 3.8275 \n",
      "03/28/2020 23:39:54 INFO: The  100-th epochs, loss is 0.7504 \n",
      "03/28/2020 23:39:54 INFO: The  200-th epochs, loss is 0.5266 \n",
      "03/28/2020 23:39:55 INFO: The  300-th epochs, loss is 0.4261 \n",
      "03/28/2020 23:39:56 INFO: The  400-th epochs, loss is 0.3633 \n",
      "03/28/2020 23:39:57 INFO: The  500-th epochs, loss is 0.3167 \n",
      "03/28/2020 23:39:58 INFO: The  600-th epochs, loss is 0.2783 \n",
      "03/28/2020 23:39:59 INFO: The  700-th epochs, loss is 0.2448 \n",
      "03/28/2020 23:40:00 INFO: The  800-th epochs, loss is 0.2152 \n",
      "03/28/2020 23:40:01 INFO: The  900-th epochs, loss is 0.1892 \n",
      "03/28/2020 23:40:01 INFO: The 1000-th epochs, loss is 0.1673 \n",
      "03/28/2020 23:40:02 INFO: The 1100-th epochs, loss is 0.1493 \n",
      "03/28/2020 23:40:03 INFO: The 1200-th epochs, loss is 0.1346 \n",
      "03/28/2020 23:40:04 INFO: The 1300-th epochs, loss is 0.1227 \n",
      "03/28/2020 23:40:05 INFO: The 1400-th epochs, loss is 0.1130 \n",
      "03/28/2020 23:40:06 INFO: The 1500-th epochs, loss is 0.1049 \n",
      "03/28/2020 23:40:07 INFO: The 1600-th epochs, loss is 0.0981 \n",
      "03/28/2020 23:40:07 INFO: The 1700-th epochs, loss is 0.0923 \n",
      "03/28/2020 23:40:08 INFO: The 1800-th epochs, loss is 0.0873 \n",
      "03/28/2020 23:40:09 INFO: The 1900-th epochs, loss is 0.0829 \n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\n",
      "Accuracy of Unchanged Regions is: 0.9798\n",
      "Accuracy of Changed Regions is:   0.6144\n",
      "The True Positive ratio is:       0.7437\n",
      "Accuracy of all testing sets is : 0.9481\n",
      "\n",
      "Accuracy of Unchanged Regions is: 0.0202\n",
      "Accuracy of Changed Regions is:   0.3856\n",
      "The True Positive ratio is:       0.0361\n",
      "Accuracy of all testing sets is : 0.0519\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAJkAAAD8CAYAAABkZQZTAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLj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hGq8svCkrQ1QRkVWSRCVH4uW5GqyDInZvqavqjIMqNpN0WpFk1FpgRHxBbrRPQ2gAOpy9GT8wC8mroQPfFZ9k8x8xLbG1KCFg8w85rUhegDEe3RsjejzaUSHBWZEhwpItuSugAD0LK3IKLjr4wbKZZMGTHJRUZEG4jogNn3X9yGeUT0IBEdJ6LnSscWEdEOk8NgBxGda44TET1gPss+IlqdruQAES0jop1EtJ+InieiO5KUn5mT/QGYB+BFAJ8GsADAswAuT1kmSxm/BGA1gOdKx34MYLN5vhnAveb5RgB/wGxz5nUAdiUu+1IAq83zjwM4CODy2OVPXYFfALC99PpuAHenFpalnMsrIjsAYGmpIg+Y5z8HcLPtPAl/mO3re33s8qduLk/t+W8o5wOQzAXMfAwAzOP55rjYz2PSD10FYBcilz+1yJz2/M8IkZ+HiM4G8BiAO5n5raZTLccGlz+1yIo9/wvK+QAk8zIRLQUA83jcHBf3eYhoPmYCe5iZHzeHo5Y/tch2A1hhMs4twCxPwBOJy+RCOVdBNYfBLWaUtg7Am0WzlAKT02orgP3MfF/prbjlF9AZ3YjZqOdFAD9MXR5L+R4BcAzA+5j90jdhlrfgKQAvmMdF5lwC8FPzWf4JYE3isn8Rs+ZuH4C95m9j7PKrx18JTurmUpkAKjIlOCoyJTgqMiU4KjIlOCoyJTgqMiU4KjIlOP8H6Upn0K+3MPIAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "if __name__ == '__main__':\n",
    "    args = config()\n",
    "    img1, img2, chg_map = utils.data_loader(area=args.area)\n",
    "    os.environ[\"CUDA_VISIBLE_DEVICES\"] = args.gpu\n",
    "    main(img1, img2, chg_map, args=args)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
